home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Almathera Ten Pack 2: CDPD 1
/
Almathera Ten on Ten - Disc 2: CDPD 1.iso
/
pd
/
351-375
/
370
/
sksh
/
check_1.5.sksh
< prev
next >
Wrap
Text File
|
1995-03-14
|
9KB
|
281 lines
b="$_ANSI_P3"
e="$_ANSI_P1"
missing="ram:.missing"
invalid="ram:.invalid"
inpath="ram:.inpath"
function clean_up {
rm "$missing" "$invalid" "$inpath"
cd "$orig_dir"
}
function check_files {
if [ ! -f "$1" ]
then
echo -c "$b" "ERROR: " "$e" "this file is missing: $1"
echo "$1" >> "$missing"
else
crcval=$("$crccmd" -q "$1")
if [ "$crcval" != "$2" ]
then
echo -c "$b" "ERROR: " "$e" "this file has an incorrect checksum: $1"
echo "$1" >> "$invalid"
fi
if [ "$3" = "pure" -a ! -P "$1" ]
then
echo -c "$b" "WARNING: " "$e" "this file should have the pure bit set: $1"
fi
if [ "$r" = "path" -a ! -z $(which -s "$1") ]
then
echo -c "$b" "ERROR: " "$e" "this file must be in your SKsh path: $1"
echo "$1" >> "$inpath"
fi
fi
}
function read_dir {
local in_dir; in_dir=''
cd $orig_dir
while [ ! -d "$in_dir" -o -z "$in_dir" ]
do
echo
echo "$1"
echo -n "$2" "$b\[$3]$e ? > "
read read_dir
eval "in_dir = $read_dir" # to get filename mapping right
if [ -z "$in_dir" ]; then in_dir = "$3"; fi
if [ ! -d "$in_dir" ]
then
echo "\n$read_dir is not a valid directory name."
fi
done
export -l in_dir
}
clear
if [ $(version -s) -lt 6 ]
then
echo "This script must be run under SKsh 1.5 or later. Please install"
echo "SKsh 1.5, run it, and then run this script."
echo
return
fi
echo '
This script will verify the installation of SKsh 1.5. It will report
missing files, files which do not have the correct checksum for this
version of SKsh, files which should have the pure bit set bit don\'t,
and files which should be in the search path but are not. It will prompt
you for the location of various commands. You must enter a valid
directory name which contains the files; for example, you might
enter "c:" (without the quotes) for the location of the main SKsh
binaries, and "sys:bin" for the location of the SKsh external commands.
This script is a reporting tool only; it will not change your filesystem.
'
if [ ! -m 'ram:' ]
then
echo "The volume ram: must be mounted for this script to run.\n"
return
fi
if [ ! -m 'sksh:' ]
then
echo "The volume sksh: must be mounted.\n"
return
fi
if [ ! -m 'vmagic:' ]
then
echo -c "$b" "WARNING: " "$e" "the volume vmagic: should be mounted.\n"
fi
crccmd=$(which -s crc)
if [ -z "$crccmd" ]
then
echo "The 'crc' command was not found in your SKsh search path. It must"
echo "be there for this script to run correctly."
echo
return
fi
orig_dir="$PWD"
echo -n > "$missing"
echo -n > "$invalid"
echo -n > "$inpath"
# --- Find dir containing sksh binary... -------------------------------------
read_dir "Please enter the name of the directory which contains the SKsh and" \
"Tiny_SKsh binaries" "c:"
echo -c "\n$_ANSI_US" "Checking SKsh binaries and init files...$_ANSI_UE" "\n"
cd "$in_dir"
check_files sksh ' 69608 5386977 612797492' 'pure' ''
check_files tiny_sksh ' 52140 3950072 614130749' 'pure' ''
initfile=FALSE
if [ -f sksh:.skshinit ]
then
initfile=TRUE
check_files sksh:.skshinit ' 3116 186843 394778686' '' ''
fi
if [ -f sksh:.skshinit.pp ]
then
initfile=TRUE
check_files sksh:.skshinit.pp ' 3487 192260 1046848713' '' ''
fi
if [ "$initfile" = 'FALSE' ]
then
check_files sksh:.skshinit ' 3116 186843 394778686' '' ''
fi
if [ ! -f 'sksh:.skshrc' ]
then
echo -c "$b" "ERROR: " "$e" "this file is missing: sksh:.skshrc"
echo "sksh:.skshrc" >> "$missing"
fi
if [ -m 'vmagic:' ]
then
if [ ! -f 'vmagic:view.magic' ]
then
echo -c "$b" "WARNING: " "$e" "this file is missing: vmagic:view.magic"
echo "vmagic:view.magic" >> "$missing"
fi
fi
if [ -s "$missing" -a -s "$invalid" -a -s "$inpath" ]
then
echo "\nSKsh binaries and init files are valid.\n"
fi
echo -n > "$missing"
echo -n > "$invalid"
echo -n > "$inpath"
# --- Find dir containing sksh external commands... --------------------------
read_dir "Please enter the name of the directory which contains the SKsh" \
"external commands" "c:"
echo -c "\n$_ANSI_US" "Checking SKsh external commands...$_ANSI_UE" "\n"
cd "$in_dir"
check_files cat ' 2640 194202 76668405' 'pure' 'path'
check_files cmp ' 3092 227924 536903169' 'pure' 'path'
check_files cp ' 4572 360911 690211346' 'pure' 'path'
check_files crc ' 2668 193827 536898298' 'pure' 'path'
check_files cut ' 3560 273017 1764043124' 'pure' 'path'
check_files du ' 3432 246205 76660976' 'pure' 'path'
check_files encr ' 3944 303081 1303786364' 'pure' 'path'
check_files fgrep ' 5316 389047 76640570' 'pure' 'path'
check_files grep ' 11628 922091 1303697934' 'pure' 'path'
check_files head ' 3032 210152 690232883' 'pure' 'path'
check_files indent ' 3312 230719 1917363458' 'pure' 'path'
check_files join ' 2920 216395 536901522' 'pure' 'path'
check_files num ' 2784 202126 76667273' 'pure' 'path'
check_files srun ' 2372 167437 536894528' 'pure' 'path'
check_files strings ' 2736 205271 1764033446' 'pure' 'path'
check_files tail ' 3552 256316 536907225' 'pure' 'path'
check_files tee ' 2880 222196 1303797919' 'pure' 'path'
check_files view ' 6200 511324 1303756615' 'pure' 'path'
check_files wc ' 3212 235859 76662454' 'pure' 'path'
check_files window ' 4840 347343 1994042642' 'pure' 'path'
check_files xd ' 3408 258472 536907533' 'pure' 'path'
if [ -s "$missing" -a -s "$invalid" -a -s "$inpath" ]
then
echo "\nSKsh external commands are valid.\n"
fi
echo -n > "$missing"
echo -n > "$invalid"
echo -n > "$inpath"
# --- Find dir containing sksh documentation... ------------------------------
echo -n "\nDo you wish to check the documentation files [y/n] ? > "; read yn
echo
if [ "$yn" = 'y' -o "$yn" = 'Y' ]
then
read_dir "Please enter the name of the directory which contains the SKsh" \
"documentation files" "MAN:"
echo -c "\n$_ANSI_US" "Checking SKsh documentation files...$_ANSI_UE" "\n"
cd "$in_dir"
check_files Addendum1.1.doc ' 7776 547357 1459834416' '' ''
check_files Addendum1.2.doc ' 10165 718963 1459854250' '' ''
check_files Addendum1.3.doc ' 21522 1579653 846405768' '' ''
check_files Addendum1.4.doc ' 27114 1931292 846451321' '' ''
check_files Addendum1.5.doc ' 31857 2358446 2073641175' '' ''
check_files Bugs.doc ' 1736 114181 1908801272' '' ''
check_files Diffs.doc ' 6200 443439 1928416014' '' ''
check_files ErrorCodes.doc ' 2404 150992 1139459547' '' ''
check_files ExtCmds.doc ' 39638 2632676 449773169' '' ''
check_files Hints.doc ' 7481 531434 376119483' '' ''
check_files Install.doc ' 6524 438132 1063822751' '' ''
check_files MiscInfo.doc ' 5858 434299 486661790' '' ''
check_files ReadMe_1st.doc ' 4920 334810 1354024267' '' ''
check_files Reference.doc ' 141416 9216291 1980178810' '' ''
check_files TechNotes.doc ' 5450 404390 40070175' '' ''
check_files TinySKsh.doc ' 3158 207136 774303659' '' ''
check_files UserMan.doc ' 102022 7261426 777852275' '' ''
check_files View.doc ' 13036 952471 475268762' '' ''
if [ -s "$missing" -a -s "$invalid" -a -s "$inpath" ]
then
echo "\nSKsh documentation files are valid.\n"
fi
fi # end of doc file check
# --- Find dir containing stuff.sksh... -----------------------------------
echo -n "\nDo you wish to check the Stuff.sksh file [y/n] ? > "; read yn
echo
if [ "$yn" = 'y' -o "$yn" = 'Y' ]
then
read_dir "Please enter the name of the directory which contains the" \
"Stuff.sksh file" "sksh:"
echo -c "\n$_ANSI_US" "Checking Stuff.sksh documentation file...$_ANSI_UE" "\n"
cd "$in_dir"
check_files Stuff.sksh ' 8428 562929 779546500' '' ''
if [ -s "$missing" -a -s "$invalid" -a -s "$inpath" ]
then
echo "\nStuff.sksh file is valid.\n"
fi
fi # end of Stuff.sksh file check
echo "\nSKsh installation checking complete."
clean_up